package com.sanjin.mall.authserver.vo;


import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class UserRegisterVo {

    //添加 JR303校验注解
    @NotEmpty(message = "用户名必须提交")
    @Size(min = 6, max = 18,message = "用户名必须是6-18位字符")
    private String userName;

    @NotEmpty(message = "密码必须提交")
    @Size(min = 6, max = 18,message = "密码必须是6-18位字符")
    private String password;

    @NotEmpty(message = "手机号必须填写")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机号格式不正确")//第一位是1，第二位是3-9，后面9位都是 0-9
    private String phone;

    @NotEmpty(message = "验证码必须填写")
    private String code;

}
